import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LayoutView from '../views/LayoutView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'LayoutView',
    component: LayoutView,
    children: [
      {
        path: '',
        name: 'home',
        component: HomeView
      },
      {
        path: '/salary',
        name: 'salary',
        component: () => import('../views/SalaryView.vue')
      },,{
        path: '/order',
        name: 'order',
        component: () => import('../views/OrderView.vue')
      },{
        path: '/evaluation',
        name: 'evaluation',
        component: () => import('../views/EvaluationView.vue')
      },{
        path: '/personal',
        name: 'personal',
        component: () => import('../views/PersonalView.vue')
      },
      //修改密码
      {
        path: '/change/password',
        name: 'ChangePassword',
        component: () => import('../views/ChangePassword.vue')
      },
      //新密码
      {
        path: '/new/password',
        name: 'NewPassword',
        component: () => import('../views/NewPassword.vue')
      },
      //修改手机号
      {
        path: '/change/phone',
        name: 'ChangePhone',
        component: () => import('../views/ChangePhone.vue')
      },
      //新手机号
      {
        path: '/new/phone',
        name: 'NewPhone',
        component: () => import('../views/NewPhone.vue')
      },
      //订单详情
      {
        path: '/order/detail',
        name: 'OrderDetail',
        component: () => import('../views/OrderDetail.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  }
]

const router = new VueRouter({
  mode:'history',
  routes
})

export default router
